<?php
/*=============================================================================
|| ##################################################################
||	phpFoX Konsort
|| ##################################################################
||
||	Copyright		: (C) 2005-2007 PHPFOX Limited a Reality Fox Creation
||	Contact			: info@phpfox.com
||
||	- phpFoX and all of its source code and files are protected by Copyright Laws.
||
||	- The license for phpFoX permits you to install this software on a single domain (.com, .org, .net, etc.).
||
||	- You may also not remove this copyright screen which shows the copyright information and credits for phpFoX (RealityFOX Creations).
||
||	- phpFoX Konsort is NOT a FREE software - http://www.phpfox.com/license/
||
|| ##################################################################
=============================================================================*/

/* $File: ./include/classes/smarty/plugins/function.i18n.php, $Author:  $ */


function smarty_function_language($params, &$smarty)
{
	if ( isset($params['translate']) )
	{
		$sSubCacheText = $params['translate'];

		unset($params['translate']);

		return App::formatTranslate($sSubCacheText, $params);
	}

	if ( isset($params['extra']) )
	{
		return App::format($params['text'],$params['extra']);
	}

	if ( isset($params['exe']) )
	{
		switch($params['exe'])
		{
			case 'ucfirst':
			return ucwords(strtolower(App::format($params['text'], $params)));
			break;
			case 'spacer':
				return str_replace(' ', '&nbsp;', App::format($params['text'], $params));	
				break;
			default:
			return App::format($params['text'], $params);
			break;
		}
	}
	else
	{
		$sCoreText = $params['text'];

		unset($params['text']);

    	return App::format($sCoreText, $params);
    }
}
?>